<template lang="html">
  <div>
    <el-row>
      <el-col :span="4" v-for="(o, index) in 2" :key="o" :offset="index > 0 ? 2 : 0">
        <el-card :body-style="{ padding: '0px' }"  @click.native="gotoDetail(o)">
          <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
          <div style="padding: 14px;">
            <span>好吃的汉堡</span>
            <div class="bottom clearfix">
              <time class="time">{{ currentDate }}</time>
              <el-button type="text" class="button">操作按钮</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>

  export default {
    data() {
      return {
        currentDate: new Date(),
        items: []
      }
    },
    methods: {
      gotoDetail(bh) {
        console.log(bh);
      }
    },
    created() {
     /* this.$http.get('/api/v1/work/page').then((data) => {
        this.items = data.body.data;
      })*/
      this.$axios.get("/api/v1/work/page").then (function (res) {
        console.log(res.data);
        this.arr = res.data;
      })
    }

    /*,
    components: {
      DetailHeader
    }*/
  }
</script>

    <style>
      .time {
        font-size: 13px;
        color: #999;
      }
      .el-card {
        /*卡片宽度*/
        width: 280px;
        font-size: 13px;
        color: #999;
      }

      .bottom {
        margin-top: 13px;
        line-height: 12px;
      }

      .button {
        padding: 0;
        float: right;
      }

      .image {
        /*width: 100%;*/
        /*图片水平居中*/
        margin: 0 auto;
        display: block;
      }

      .clearfix:before,
      .clearfix:after {
        display: table;
        content: "";
      }

      .clearfix:after {
        clear: both
      }
    </style>
